import request from '@/utils/request'

// 获取经纪列表
export function getAgentsList(params) {
  return request({
    url: '/agents',
    params
  })
}

// 删除经纪
export function delAgents(id) {
  return request({
    url: '/agents/' + id,
    method: 'delete'
  })
}

// 获取指定经纪
export function getDetail(id) {
  return request({
    url: `/agents/${id}`

  })
}

// 编辑经纪
export function writeAgents(data) {
  return request({
    url: `/agents/${data.id}`,
    method: 'put',
    data
  })
}

// 新增经纪
export function addAgents(data) {
  return request({
    url: '/agents',
    method: 'post',
    data
  })
}

// 获取经纪数量
export function getCount(params) {
  return request({
    url: '/agents/count',
    params
  })
}
